package com.example.es.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

@Document(indexName = "index_popyu")
@Setting(replicas = 0, shards = 1)   // 开发阶段简化
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UsrDoc {

    @Id
    @Field(type = FieldType.Keyword)
    private String usrId;

    @Field(type = FieldType.Text)
    private String usrNm;

    @Field(type = FieldType.Integer)
    private Integer usrAge;

    @Field(type = FieldType.Keyword)
    private String usrCity;

    @Field(type = FieldType.Keyword)
    private String usrPhone;

    @Field(type = FieldType.Date, format = DateFormat.date)
    private String joinDate;   // yyyy-MM-dd

    @Field(type = FieldType.Date, format = DateFormat.hour_minute_second)
    private String joinTime;   // HH:mm:ss
}